//
// Decompiled by Jadx - 386ms
//
package me.plusne.ViewTools.View;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;
import de.aa;

public class CircleImageView extends View {
    public Paint a;
    public Paint b;
    public Paint c;
    public String d;
    public int e;
    public float f;
    public int g;
    public final float h;

    public CircleImageView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        this.d = "A";
        this.e = -1;
        this.f = 60.0f;
        this.g = 0;
        this.h = 8.0f;
        Paint paint = new Paint();
        this.a = paint;
        paint.setColor(-16776961);
        this.a.setAntiAlias(true);
        Paint paint2 = new Paint();
        this.b = paint2;
        paint2.setColor(this.e);
        this.b.setTextSize(this.f);
        this.b.setAntiAlias(true);
        this.b.setTextAlign(Paint.Align.CENTER);
        Paint paint3 = new Paint();
        this.c = paint3;
        paint3.setColor(this.g);
        this.c.setStrokeWidth(8.0f);
        this.c.setStyle(Paint.Style.STROKE);
        this.c.setAntiAlias(true);
        if (attributeSet != null) {
            TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, aa.aj);
            this.a.setColor(obtainStyledAttributes.getColor(0, -16776961));
            String string = obtainStyledAttributes.getString(1);
            this.d = string;
            if (string == null) {
                this.d = "A";
            }
            float dimension = obtainStyledAttributes.getDimension(2, this.f);
            this.f = dimension;
            this.b.setTextSize(dimension);
            obtainStyledAttributes.recycle();
        }
    }

    public final void i(String str, int i, int i2) {
        this.a.setColor(i);
        this.g = i2;
        this.c.setColor(i2);
        this.d = str;
        this.e = -16777216;
        invalidate();
    }

    @Override
    public final void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        int width = getWidth();
        int height = getHeight();
        int min = Math.min(width, height) / 2;
        float f = width / 2.0f;
        float f2 = height / 2.0f;
        float f3 = min;
        canvas.drawCircle(f, f2, f3, this.a);
        canvas.drawCircle(f, f2, f3 - (this.h / 2.0f), this.c);
        canvas.drawText(this.d, f, f2 - ((this.b.ascent() + this.b.descent()) / 2.0f), this.b);
    }

    public void setCircleColor(int i) {
        this.a.setColor(i);
        invalidate();
    }

    public void setInitial(String str) {
        this.d = str;
        invalidate();
    }
}
